Chapter 16: Meta-Analysis

Author

Colin Foster

Welcome to the online content for Chapter 16!

As always, I’ll assume that you’ve already read up to this chapter of the book and worked through the online content for the previous chapters. If not, please do that first.

As always, click the ‘Run Code’ buttons below to execute the R code. Remember to wait until they say ‘Run Code’ before you press them. And be careful to run these boxes in order if later boxes depend on you having done other things previously.

Forest plot

Let’s begin by reading in data on the 6 studies, and I’ll call the dataframe ‘studies’:

The rows represent the different studies, and each study has an effect size and a standard deviation of that effect size.

We notice that Study 6 has a negative effect size, as discussed in the chapter.

To run the meta-analysis, we’ll use the metafor package, so let’s install that:

We wait a few moments while that loads.

Now, we can run a random-effects meta-analysis using the rma function, and show the forest plot with the forest function:

This matches the plot given in the chapter.

Analysis

We can obtain all of the other information that we need from the ‘results’ object that the rma function created:

We see the values of tau and tau2, \(I^2\), and \(Q\), with its significance test, and these match the values given in the chapter.

Under ‘Model Results:’ we see the summary effect size estimate in the ‘estimate’ column, given as 0.1647, with its standard error (‘se’) of 0.0779 and \(p\) value of .0346. The final two columns (‘ci.lb’ and ‘ci.ub’) are the lower bound and upper bound of the 95% confidence interval.

Funnel plot

We can obtain a funnel plot with the funnel command:

As mentioned in the chapter, with just 6 studies we can’t conclude much from this.